<template>
  <div class="changePassword">
    <div class="changePassword_model">
      <el-form ref="form" label-width="120px" :model="form" :rules="rules" class="changePassword_model__form">
        <el-form-item label="原密码" prop="password">
          <el-input v-model.trim="form.password" type="password" placeholder="请输入原密码"></el-input>
        </el-form-item>
        <el-form-item label="新密码" prop="newPasswrod">
          <el-input v-model.trim="form.newPasswrod" type="password" placeholder="请输入新密码"></el-input>
        </el-form-item>
        <el-form-item label="再次输入新密码" prop="againPasswrod">
          <el-input v-model.trim="form.againPasswrod" type="password" placeholder="请再次输入新密码"></el-input>
        </el-form-item>
        <el-form-item class="mg-b0">
          <el-button type="primary" @click="save" :loading="loading">{{ config.root.submit }}</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
  import Mixin from '@/mixins/form'

  export default {
    name: 'changePassword',
    mixins: [Mixin],
    components: {},
    filters: '',
    data () {
      return {
        rules: {
          password: [
            { required: true, message: '请输入原密码', trigger: 'blur' }
          ],
          newPasswrod: [
            { required: true, message: '请输入新密码', trigger: 'blur' }
          ],
          againPasswrod: [
            { required: true, message: '请再次输入新密码', trigger: 'blur' }
          ]
        }
      }
    },
    created () {
    },
    methods: {
      // 保存
      save () {
        // 表单验证
        const status = this.$formValidate()
        if (status) {
          this.$Tips('success', '保存成功')
        }
      }
    }
  }
</script>s

<style lang="scss" scoped>
  .changePassword {
    height: calc(100vh - 130px);
    background-color: $white;
    display: flex;
    align-items: center;
    justify-content: center;

    .changePassword_model {
      padding: 30px;
    }
  }
</style>
